import React from 'react'
import Goods from '../../pages/Goods/Goods'
import axios from 'axios'
class GoodsZ extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            sortData: []
        }
    }
    componentDidMount() {
        this.orderAxios()
    }
    orderAxios = () => {
        axios({
            url: 'api1/olife/goods/queryTypeList',
            method: 'GET',
            params: {
                currentPage: '1',
                pageSize: '20',
                shop_phone: '1'
            }
        }).then(data => {
            let c = data.data.dataList
            if (c !== '') {
                this.setState({ sortData: c })
            }
            console.log(this.state.sortData);
        }).catch(err => {
            console.log(err);
        })
    }
    render() {
        return (
            <div>
                <Goods sortData={this.state.sortData} comAxios={this.orderAxios}></Goods>
            </div>
        )
    }
}
export default GoodsZ